<!-- #encoding: utf-8 -->

<h1>Languages and Countries</h1>

<h3>Language and Country support for input select fields using ISO Codes</h3>

<div>
<dl>
  <dt>Language Codes</dt>
  <dd>639-1</dd>
  <dt>Country Codes</dt>
  <dd>ISO 3166-1 Alpha-2</dd>
</dl>
</div>

<h1>form_for helpers</h1>

<div id="language_name_select" class="field">
<%= form_for(Language.new) do |f| %>
  <%= f.label :name, "English Name to English Name" %>
  <%= f.language_name_select :name, {}, id: "language[language_name_select]" %>
<% end %>
</div>

<div id="language_native_select" class="field">
<%= form_for(Language.new) do |f| %>
  <%= f.label :name, "Native Name to Native Name" %>
  <%= f.language_native_select :name, {}, id: "language[language_native_select]" %>
<% end %>
</div>

<div id="language_code_select" class="field">
<%= form_for(Language.new) do |f| %>
  <%= f.label :name, "Language Code to Native Name" %>
  <%= f.language_code_select :name, {}, id: "language[language_code_select]" %>
<% end %>
</div>

<div id="country_name_select" class="field">
<%= form_for(Language.new) do |f| %>
  <%= f.label :name, "English Country Name to English Country Name" %>
  <%= f.country_name_select :name, {}, id: "language[country_name_select]" %>
<% end %>
</div>

<div id="country_code_select" class="field">
<%= form_for(Language.new) do |f| %>
  <%= f.label :name, "Code to English Country Name" %>
  <%= f.country_code_select :name, {}, id: "language[country_code_select]" %>
<% end %>
</div>

<h1>form_tag helpers</h1>

<div id="language_name_select_tag" class="field">
<%= form_tag(languages_path) do %>
  <%= label_tag :name, "English Name to English Name" %>
  <%= language_name_select_tag :name, id: "language[language_name_select_tag]" %>
<% end %>
</div>

<div id="language_native_select_tag" class="field">
<%= form_tag(languages_path) do %>
  <%= label_tag :name, "Native Name to Native Name" %>
  <%= language_native_select_tag :name, id: "language[language_native_select_tag]" %>
<% end %>
</div>

<div id="language_code_select_tag" class="field">
<%= form_tag(languages_path) do %>
  <%= label_tag :name, "Language Code to Native Name" %>
  <%= language_code_select_tag :name, id: "language[language_code_select_tag]" %>
<% end %>
</div>

<div id="country_name_select_tag" class="field">
<%= form_tag(languages_path) do %>
  <%= label_tag :name, "English Country Name to English Country Name" %>
  <%= country_name_select_tag :name, id: "language[country_name_select_tag]" %>
<% end %>
</div>

<div id="country_code_select_tag" class="field">
<%= form_tag(languages_path) do %>
  <%= label_tag :name, "Code to English Country Name" %>
  <%= country_code_select_tag :name, id: "language[country_code_select_tag]" %>
<% end %>
</div>